# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-scapy
_pkgname=scapy
pkgver=2.4.3
pkgrel=3
pkgdesc='Powerful interactive packet manipulation program written in Python.'
url='http://www.secdev.org/projects/scapy/'
arch=('any')
license=('GPL2')
depends=('python2' 'tcpdump')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('b2ca6abf966ccde7f6e31b0f4dc7c035244138aed468d3162ab086031c7b0e9aec1c610aeb3f3ab336650286887c4911880df405193726e6b96d2e79e5acffe1')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  for i in "$pkgdir/usr/bin/"*; do
    mv $i "${i}2"
  done

  rm -rf "$pkgdir/usr/share"
}

